// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import vueX from 'vuex';
import 'lib-flexible'/*移动端响应式 */;
import echarts from 'echarts';
import axios from 'axios';
import wx from 'weixin-js-sdk';
import ElementUI from 'element-ui';
import '../node_modules/element-ui/lib/theme-chalk/index.css';





import VueAwesomeSwiper from 'vue-awesome-swiper';
import 'swiper/dist/css/swiper.css';
import QRCode from 'qrcodejs2';
import html2canvas from 'html2canvas';
Vue.prototype.QRCode = QRCode;
Vue.prototype.html2canvas = html2canvas;
import VueAMap from 'vue-amap';
Vue.use(VueAwesomeSwiper)










Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
    key: 'e9dc8af485ecf2e4a0d41c06691e6325',
    plugin: [
        'AMap.Autocomplete',
        'AMap.PlaceSearch',
        'AMap.Scale',
        'AMap.OverView',
        'AMap.ToolBar',
        'AMap.MapType',
        'AMap.PolyEditor',
        'AMap.CircleEditor',
        'AMap.Geolocation'
    ]
});
Vue.config.productionTip = false;
// Vue.prototype.wx = wx;
Vue.prototype.axios = axios;
Vue.prototype.$echarts = echarts;
Vue.prototype.APIHOST = process.env.API_HOST;
Vue.prototype.APPID = "wxe4991dca0fc6f269";
// Vue.prototype.token = '?token=oyr73Bw5cTBreA';
// Vue.prototype.token = '?token='+localStorage.getItem('token');

/*弹框提示*/
import dialogBoxTips from './assets/js/public'
dialogBoxTips(Vue)

Vue.use(vueX)

Vue.use(ElementUI)

import filters from './assets/js/vueFilter'
//注册全局filter
for (let key in filters) {
    Vue.filter(key, filters[key])
}

let store = new vueX.Store({
    state:{
        MyCity:'',/*当前城市 */
        token: localStorage.getItem("token") ? localStorage.getItem("token") : '',
        myUserInfo:{},/* 登陆后取到的个人信息*/
        cartInfo:{},/*制作图片editImg赋值 */
    },
    mutations:{
        setCity(state,newCity){
            state.MyCity = newCity;
            // localStorage.setItem('MyCity', newCity)
        }
        ,
        setToken(state, newToken) {
            state.token = newToken;
            localStorage.setItem('token', newToken)
        },
        setMyUserInfo(state, newMyUserInfo){
            state.myUserInfo = newMyUserInfo;
            localStorage.setItem('myUserInfo', JSON.stringify(newMyUserInfo))
        },
        setCartInfo(state,newCartInfo){
            state.cartInfo=newCartInfo;
            localStorage.setItem('cartInfo', JSON.stringify(newCartInfo))
        }
    }

})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,

    store,
  components: { App },
  template: '<App/>'
})
